package com.caesar.exer1_2;

import lombok.Data;

import java.util.LinkedList;
import java.util.Queue;

/**
 * @author caesar
 * @date 2025/7/18
 * @Description:
 * @apiNote
 */

public class BankQueueSystem {
    private  Queue<Customer> queue;
    public BankQueueSystem() {
        this.queue = new LinkedList<>();
    }
    public void addCustomer(Customer customer)//添加一个客户
    {
        queue.offer(customer);
    }
    public Customer serveNextCustomer()//服务下一个客户
    {
        return queue.poll();
    }
    public int getSize()//查看排队人数
    {
        return queue.size();
    }
    public boolean isEmpty()//判断队列是否为空
    {
        return queue.isEmpty();
    }
    public Customer getNextCustomer() {//查看队列中的下一个客户。
        return queue.peek();//查看队列的头部元素，但不将其从队列中移除
    }
}
